home *** CD-ROM | disk | FTP | other *** search
/ Mac Mania 4 / MacMania 4.toast / / Sound / SoundEffects 0.9.2 / SoundEffects Developer’s Kit / Interfaces / ModSetups.h < prev    next >
Text File  |  1994-09-06  |  3KB  |  68 lines

  1. //    Use these values in the 'type'            Put these values in the 'param' field…
  2. //    field…
  3. enum
  4. {
  5.     type_ignore = 0,                    //    unused.
  6.     type_button,                        //    ProcPtr to an action procedure.
  7.     type_checkBox,                        //    Ptr to a short, true if ON, false if OFF.
  8.     type_checkBoxNoSave,
  9.     type_radioButton,                    //    Ptr to a short, containing the index of the
  10.     type_radioButtonNoSave,                //    active radio button in the group. Pass the same
  11.                                         //    pointer to the same short to every radio button
  12.                                         //    in the same group. Indexes start from 1.
  13.     type_unitsPopup,                    //    Ptr to a short, containing one of the values
  14.                                         //    defined in ModUnits.h.
  15.     type_editFieldUnitDependent,        //    Ptr to an unsigned long, containing a value
  16.     type_editFieldUnitDependentNoSave,    //    in bytes. There MUST be a type_unitsPopup item
  17.                                         //    if one or more of these is present. Conversions
  18.                                         //    are handled automatically, but the value in the
  19.                                         //    variable will always be in bytes.
  20.     type_editFieldNumerical,            //    Ptr to a long.
  21.     type_editFieldNumericalNoSave,
  22.     type_editFieldNumDecimal,            //    Ptr to a double.
  23.     type_editFieldNumDecimalNoSave,
  24.     type_editField,                        //    StringPtr.
  25.     type_editFieldNoSave,
  26.     type_customItem                        //    Ptr to a SettCustomItemRec record.
  27.                                         //    if the saveProc field of the record is 0L,
  28.                                         //    the custom item’s data won’t be remembered
  29.                                         //    with the setups.
  30. };
  31.  
  32. //    The 'NoSave' types will not be remembered with the setups, but will work the same
  33. //    way as the others otherwise.
  34.  
  35.  
  36. typedef struct {
  37.     ProcPtr            actionProc;
  38.     ProcPtr            drawProc;
  39.     ProcPtr            saveProc;
  40.     long            refCon;
  41. } SettCustomItemRec;
  42.  
  43. enum
  44. {
  45.     customItemMsg_init = 1,
  46.     customItemMsg_hit,
  47.     customItemMsg_close,
  48.     
  49.     customItemSaveMsg_save,
  50.     customItemSaveMsg_load
  51. };
  52.  
  53.  
  54. //    type_button procedures should be declared as:
  55. //        OSErr ButtonProcedure(DialogPtr myDlog, short itemHit, short additionalItems)
  56. //    where itemHit is the index of the button item in the DITL, but since there are
  57. //    other items in the dialog, if you want to call one of the Dialog Manager routines,
  58. //    you have to pass it additionalItems+itemHit as the item number.
  59. //
  60. //    type_button and type_customItem procedures should return:
  61. //    1                - if everything was fine,
  62. //    0                - if you want to dismiss the dialog as if the user clicked OK,
  63. //    kModCancel        - if you want to dismiss the dialog as if the user clicked Cancel,
  64. //    -1                - if the setups pop-up menu is shown and you just changed
  65. //                        something so the values are now different from the ones
  66. //                        corresponding to any selected setup.
  67. //    any other value    - if you want to cancel and report the corresponding error,
  68.